package efi.easycooking.eng;
import efi.easycooking.R;
import android.content.Context;
import android.graphics.Color;
import android.graphics.Typeface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.TextView;

public class EngImageAdapter extends BaseAdapter {

	public static int[] images = {
			//R.drawable.menu_item_buscador,	
			//R.drawable.menu_item_donde_estoy,
		//R.drawable.menu_item_config,
		//R.drawable.menu_item_salir
		R.drawable.cookbook,
		R.drawable.duend,
		R.drawable.busq
			
			
	};
			
	private Context context;
	
	public EngImageAdapter(Context applicationContext){
		context=applicationContext;
				
	}
	
	@Override
	public int getCount() {
		//number of datelements to be displayed
		return images.length;
	}

	@Override
	public Object getItem(int position) {
		
		return null;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		View v = convertView;
		
		if (v == null) {
			 LayoutInflater li = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	         v = li.inflate(R.layout.grid_item, null);
	         TextView tv = (TextView)v.findViewById(R.id.grid_item_text);
	         tv.setTextColor(Color.BLACK);
	         tv.setTextSize(10);
	         tv.setTypeface(Typeface.SERIF, Typeface.BOLD);
	         ImageView iv = (ImageView)v.findViewById(R.id.grid_item_image);
	         
	         //iv.setLayoutParams(new GridView.LayoutParams(80, 80));
	            iv.setScaleType(ImageView.ScaleType.CENTER_CROP);
	            
	         switch (position) {
	         case 0:
	        	 tv.setText("Main");
	        	 iv.setImageResource(images[position]);
	        	 
	        	 break;
	         case 1:
	        	 tv.setText("Will be Lucky!");
	        	 iv.setImageResource(images[position]);
	        	 
	        	 break;
	         case 2:
	        	 tv.setText("Recipe Search");
	        	 iv.setImageResource(images[position]);
	        	 break;
	         case 3:
	        	// tv.setText("French");
	        	// iv.setImageResource(images[position]);
	        	 break;
	         }
	         
		}
		return v;
	}
}
